﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;

namespace Imple.Util
{
    public class RSSVersionReader
    {
        public static string ReadVersion(string input)
        {
            if (string.IsNullOrEmpty(input))
                return string.Empty;

            Regex reg = new Regex("<rss version=\"([02]\\.(?:0|92|91))\".*",
                RegexOptions.IgnoreCase | RegexOptions.Compiled);
            Match m = reg.Match(input);
            if (!m.Success)
                return string.Empty;
            return m.Groups[1].Value;
        }
    }
}
